using System.Collections.Generic;
using UnityEngine;

public class CameraSettings : ScriptableObject
{
	private static CameraSettings instance_;

	protected List<CameraBehaviour> allCameras;

	public List<HumanPlayerCamera> humanCameras = new List<HumanPlayerCamera>();

	public static CameraSettings instance
	{
		get
		{
			if (instance_ == null)
			{
				instance_ = Resources.Load<CameraSettings>("CameraSettings");
				instance_.Init();
			}
			return instance_;
		}
	}

	protected void Init()
	{
		allCameras = new List<CameraBehaviour>();
		foreach (HumanPlayerCamera humanCamera in humanCameras)
		{
			allCameras.Add(humanCamera);
		}
	}

	public CameraBehaviour GetCamera(CameraBehaviour.CameraPosition position)
	{
		foreach (CameraBehaviour allCamera in allCameras)
		{
			if (allCamera.position == position)
			{
				return allCamera;
			}
		}
		return null;
	}
}
